<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>考试列表 - 英语单词测试系统</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
    <div class="container-fluid">
        <a class="navbar-brand" href="/teacher">英语单词测试系统</a>
        <div class="d-flex">
            <a href="/logout" class="btn btn-outline-light">退出登录</a>
        </div>
    </div>
</nav>
<div class="container mt-5">
    <h4 class="mb-4">考试列表</h4>
    <table class="table table-bordered table-hover align-middle">
        <thead class="table-primary">
            <tr>
                <th>考试名称</th>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>题目数量</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for exam in exams %}
            <tr>
                <td>{{ exam.name }}</td>
                <td>{{ exam.start_time.strftime('%Y-%m-%d %H:%M') }}</td>
                <td>{{ exam.end_time.strftime('%Y-%m-%d %H:%M') }}</td>
                <td>{{ exam.questions|length }}</td>
                <td>
                    <a href="/exam/{{ exam.id }}" class="btn btn-sm btn-outline-primary">详情/统计</a>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
    <a href="/create_exam" class="btn btn-primary">+ 创建新考试</a>
</div>
</body>
</html>
